#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

int maxProfit(vector<int>& prices, int fee) {
    int n = prices.size();
    vector<int> f(n + 10, 0);
    vector<int> g(n + 10, 0);

    f[1] = -prices[0];
    for (int i = 2; i <= n; ++i)
    {
        f[i] = max(f[i - 1], g[i - 1] - prices[i - 1]);
        g[i] = max(f[i - 1] + prices[i - 1] - fee, g[i - 1]);
    }

    return g[n];
}

int main()
{

	return 0;
}